<?php
header ("Content-Type:text/html; charset= utf-8");
if(empty($_GET['channel_id'])||empty($_GET['article_id'])){
	echo "forbidden";
	exit();
}
require_once ('config.php');
require_once (WEBSITEURL.'/'.ADMINLOC.'/article_templates.php');
require_once (WEBSITEURL.'/'.ADMINLOC.'/channel_templates.php');
require_once (WEBSITEURL.'/'.ADMINLOC.'/channel_list_templates.php');
$channel_id=$_GET['channel_id'];
$article_id=$_GET['article_id'];
$article_title=getArticleTitleInfo($article_id);
$system=new System();
$sys_style=$system->getSysStyle();
$article_model=basename($system->getArticleModel($channel_id));
if($article_model==""||(!file_exists(WEBSITEURL."/templates/$sys_style/article/$article_model"))){
	$article_model="default.htm";
};
/*点击次数加一*/
$sql_update_article_click="update article_normal set article_click=article_click+1 where article_id=$article_id";
$result_update_article_click=mysql_query($sql_update_article_click);

$smarty->template_dir=WEBSITEURL."/templates/$sys_style/article";
$smarty->assign("template_dir","templates/$sys_style");
$smarty->assign("channel_id",$channel_id);
$smarty->assign("article_id",$article_id);
$smarty->assign("article_title",$article_title);
$smarty->registerPlugin("block","article","article"); //注册block
$smarty->registerPlugin("block","channel","channel"); //注册block
$smarty->registerPlugin("block","channellist","channellist"); //注册block
$smarty->display("$article_model",md5("article".$article_model));
